Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cli: enrich the error about required template value with a hint #3200

Merged
merged 1 commit into from
Mar 6, 2024

Conversation

zummenix
Copy link
Contributor

@zummenix zummenix commented Mar 3, 2024

This is another implementation variant to improve discoverability of template-aliases (#3175)

If accepted, supersedes the solution implemented in #3189 PR. Thanks to @yuja for the suggestion.

Several jj commands accept --template <TEMPLATE> argument. When the argument is empty, jj will show the list of defined symbol names.

λ jj log -T
error: a value is required for '--template <TEMPLATE>' but none was supplied

For more information, try '--help'.

The following symbol names are defined:
- builtin_change_id_with_hidden_and_divergent_info
- builtin_log_comfortable
- builtin_log_compact
- builtin_log_detailed
- builtin_log_oneline
- builtin_op_log_comfortable
- builtin_op_log_compact
- commit_summary_separator
- description_placeholder
- email_placeholder
- name_placeholder

Checklist

If applicable:

  • I have updated CHANGELOG.md
  • I have updated the documentation (README.md, docs/, demos/)
  • I have updated the config schema (cli/src/config-schema.json)
  • I have added tests to cover my changes

@zummenix zummenix force-pushed the enrich-empty-template-value-error branch from 28e2d12 to fb39337 Compare March 3, 2024 10:59
Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I personally prefer this design over #3189. Thanks for trying it.

cli/src/cli_util.rs Outdated Show resolved Hide resolved
cli/src/command_error.rs Outdated Show resolved Hide resolved
cli/src/command_error.rs Outdated Show resolved Hide resolved
@zummenix zummenix self-assigned this Mar 4, 2024
@zummenix zummenix force-pushed the enrich-empty-template-value-error branch from fb39337 to 111943d Compare March 4, 2024 17:37
@zummenix zummenix marked this pull request as ready for review March 4, 2024 17:38
@zummenix
Copy link
Contributor Author

zummenix commented Mar 4, 2024

I believe, I've handled all review comments and it's ready for final review.

Closes #3175

Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks!

cli/src/cli_util.rs Outdated Show resolved Hide resolved
cli/src/cli_util.rs Outdated Show resolved Hide resolved
cli/src/cli_util.rs Outdated Show resolved Hide resolved
cli/src/command_error.rs Outdated Show resolved Hide resolved
@zummenix zummenix force-pushed the enrich-empty-template-value-error branch 2 times, most recently from c79281d to e74fbec Compare March 5, 2024 04:52
@zummenix zummenix requested a review from yuja March 5, 2024 05:02
cli/src/cli_util.rs Outdated Show resolved Hide resolved
@zummenix zummenix force-pushed the enrich-empty-template-value-error branch from e74fbec to 2e9ef82 Compare March 5, 2024 18:14
Several `jj` commands accept `--template <TEMPLATE>` argument. When the argument
is empty, `jj` will show the list of defined template aliases.
@zummenix zummenix force-pushed the enrich-empty-template-value-error branch from 2e9ef82 to 551113f Compare March 5, 2024 18:16
@zummenix zummenix requested a review from yuja March 5, 2024 18:25
Copy link
Contributor

@yuja yuja left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. Feel free to merge it.

@zummenix zummenix merged commit 38d14ea into jj-vcs:main Mar 6, 2024
16 checks passed
@zummenix zummenix deleted the enrich-empty-template-value-error branch March 6, 2024 03:12
@zummenix
Copy link
Contributor Author

zummenix commented Mar 6, 2024

Thank you for review! :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants